1. Technical Field
The present invention relates to a method and system for data processing in general, and in particular to a method and system for generating random numbers. Still more particularly, the present invention relates to a method and system for generating actual random numbers within a multiprocessor system.
2. Description of the Prior Art
Random number generators can be commonly found in electronic gaming devices, such as poker, roulette, and slot machines, in which randomness is critically important to ensure fairness of a game. There are several important and desirable characteristics when designing a random number generator. First, every possible choice in the designated range of numbers must be obtainable. Second, the probability of a number appearing should be the same as the probability of any other number. Third, the occurrence of a number does not favor or disfavor the occurrence of any other number. Fourth, there should be a long period before random number permutations begin to recycle, if such is necessary. Finally, minimal hardware should be required.
Computers have long been used to implement random number generator algorithms for generating random numbers. However, the prior art random number generator algorithms seldom, if even, have all the above-mentioned characteristics. In fact, many prior art random number generator algorithms always provide pseudo random numbers instead of real random numbers, meaning although the sequence of numbers produced appears to be random, the sequence is repeatable. Moreover, due to certain constraints associated with the register size of a computer, many random number generator algorithms are not able to generate random numbers with long recycle periods without an increase in complexity to a point where generation of real random numbers becomes unacceptably expensive. Consequently, it would be desirable to provide an improved method and system for generating actual random numbers.
In accordance with a preferred embodiment of the present invention, a first processing thread is continuously writing to a shared memory space while a second processing thread is continuously reading from the same shared memory space without utilizing a locking mechanism for synchronizing the two processing threads. Preferably, each of the processing threads is executed on a separate processing unit. A real random number can then be generated from the data read from the shared memory space by the second processing thread.
All objects, features, and advantages of the present invention will become apparent in the following detailed written description.